package loader.dewey;
import java.util.LinkedList;
import java.util.List;

enum XmlType
{
	ELEMENT(0),
	TEXT(1),
	ATTRIBUTE(2);
	
	private final int db_id;
	
	XmlType(int type)
	{
		this.db_id = type;
	}
	
	public int toInt()	
	{
		return this.db_id;
	}
}

public class DeweyXmlElement 
{
	private int document_id;
	private String dewey;
	private int path_id;
	private String value;
	private List<DeweyXmlAttribute> attributes = new LinkedList<DeweyXmlAttribute>();
	
	public void setDocument_id(int document_id) {
		this.document_id = document_id;
	}
	public int getDocument_id() {
		return document_id;	
	}
	public void setDewey(String dewey) {
		this.dewey = dewey;
	}
	public String getDewey() {
		return dewey;
	}
	public void setPath_id(int path_id) {
		this.path_id = path_id;
	}
	public int getPath_id() {
		return path_id;
	}
	public void setValue(String value) {
		this.value = value;
	}
	public String getValue() {
		return value;
	}		
	public void addAttribute(DeweyXmlAttribute att) {
		attributes.add(att);
	}
	public List<DeweyXmlAttribute> getAttributes() {
		// TODO Auto-generated method stub
		return attributes;		
	}	
	
	public String getSqlValueString()
	{
		return "(" + getDocument_id() + ", '" + getDewey() + "', " + getPath_id() + ", '" + getValue() + "')"; 
	}
}
